﻿<%@ Page Language="C#" MasterPageFile="~/Views/Shared/Site.Master" AutoEventWireup="true" CodeBehind="EditAlb.aspx.cs" Inherits="MusicSite.Views.Content.Album.EditAlb" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
    Create/Edit album
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
<form id="form1" runat="server">
    <h2>Create/Edit album</h2>
    
    <fieldset>
        <legend>Fields</legend>
        <table class="regform">
            <tr>
                <td>
                    <asp:Label ID="label1" runat="server" AssociatedControlID="albumName" Text="Name:"></asp:Label>
                </td>
                <td>
                    <asp:TextBox ID="albumName" runat="server" ></asp:TextBox>
                    <asp:RequiredFieldValidator ID="validatorName" runat="server" EnableClientScripts="true"
                        ControlToValidate="albumName" ErrorMessage="You must provide an album name!"
                        InitialValue=""></asp:RequiredFieldValidator>
                </td>
            </tr>

            <tr>
                <td>
                    <asp:Label ID="label5" runat="server" AssociatedControlID="" Text="Release date:"></asp:Label>
                </td>
                <td>
                    <asp:TextBox ID="releaseDate" runat="server"></asp:TextBox>
                    <asp:RequiredFieldValidator runat="server" ID="validatorDate" EnableClientScripts="true"
                        ControlToValidate="releaseDate" 
                        ErrorMessage="You must provide a release date!" InitialValue="">
				    </asp:RequiredFieldValidator>
				    <asp:RegularExpressionValidator ID="validatorDate3" runat="server" EnableClientScripts="true"
                        ControlToValidate="releaseDate"
				        ValidationExpression="\d{1,2}.\d{1,2}.\d{1,4}"
				        ErrorMessage="Please enter a valid date!"></asp:RegularExpressionValidator>
				    <%--<asp:RangeValidator runat="server" ID="validatorDate2" ControlToValidate="releaseDate" 
				        MinimumValue="01-01-1900" MaximumValue="31-12-2009" Type="Date" 
				        ErrorMessage="Please enter a valid date!">
    			    </asp:RangeValidator>--%>
                </td>
            </tr>
            <tr>
                <td>
                    <asp:Label ID="label2" runat="server" AssociatedControlID="style" Text="Style:"></asp:Label>
                </td>
                <td>
                    <asp:TextBox ID="style" runat="server" ></asp:TextBox>
                    <asp:RequiredFieldValidator ID="validatorStyle" runat="server" EnableClientScripts="true"
                        ControlToValidate="style" ErrorMessage="You must provide a style!"
                        InitialValue=""></asp:RequiredFieldValidator>
                </td>
            </tr>
            <tr>
                <td>
                    <asp:Label ID="label7" runat="server" AssociatedControlID="artist" Text="Artist:"></asp:Label>                
                </td>
                <td>
                    <asp:DropDownList ID="artist" runat="server"></asp:DropDownList>
                </td>
            </tr>
            <tr>
                <td>
                    <asp:Label ID="label6" runat="server" AssociatedControlID="url" Text="Web link:"></asp:Label>
                </td>
                <td>
                    <asp:TextBox ID="url" runat="server" ></asp:TextBox>
                    <asp:RequiredFieldValidator ID="validatorUrl" runat="server" EnableClientScripts="true"
                        ControlToValidate="url" ErrorMessage="You must provide a web link!"
                        InitialValue=""></asp:RequiredFieldValidator>
                    <asp:CustomValidator ID="validatorUrl2" runat="server"
                        ControlToValidate="url" ErrorMessage="Enter please valid web link!"
                        OnServerValidate="ValidateUrl"></asp:CustomValidator>
                </td>
            </tr>
            <tr>
                <td>
                    <asp:Label ID="label3" runat="server" AssociatedControlID="cover" Text="Cover:"></asp:Label>
                </td>
                <td>
                    <asp:Image ID="cover" runat="server" CssClass="photo"/>
                    <%--<asp:TextBox ID="cover" runat="server"></asp:TextBox>  --%>       
                </td>
            </tr>
            <tr>
                <td>
                    <asp:Label ID="label4" runat="server" AssociatedControlID="fileUpload" Text="Cover URL:"></asp:Label>
                </td>
                <td>
                    <asp:FileUpload ID="fileUpload" runat="server"/>
                </td>
            </tr>
            <tr>
                <td>
                    <asp:LinkButton ID="btnUpdate" runat="server" Text="Update" 
                        OnCommand="UpdateAlbum"></asp:LinkButton>
                </td>
                <td>
                    <asp:LinkButton ID="btnDelete" runat="server" Text="Delete" 
                        OnCommand="DeleteAlbum"></asp:LinkButton>
                </td>
            </tr>
        </table> 
               
    </fieldset>
    <div>
        <asp:HyperLink ID="hyperLink" runat="server" Text="Back to list"
            NavigateUrl="~/Views/Content/Album/IndexAlb.aspx" ></asp:HyperLink>    
           
    </div>
</form>
</asp:Content>
